package pers.supeijin.devtools.converter.wx2vue;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.command.WriteCommandAction;
import com.intellij.psi.PsiFile;

import pers.supeijin.devtools.converter.wx2vue.converter.script.EventConvertUtils;
import pers.supeijin.devtools.utils.GeneralContext;

/**
 * @author bluefox
 * @date 2021/1/27.
 */
public class TestAnAction extends AnAction {

	@Override
	public void actionPerformed(AnActionEvent e) {
		GeneralContext generalContext = new GeneralContext(e);
		PsiFile psiFile = generalContext.getPsiFile();
//		WriteCommandAction.runWriteCommandAction(generalContext.getProject(),()-> LocalJSReferenceConvertUtils.convertFieldsCallExpression(psiFile));
		WriteCommandAction.runWriteCommandAction(generalContext.getProject(),()->{
			EventConvertUtils.convertDataset(psiFile);
			EventConvertUtils.converttriggerEvent(psiFile);
		});
	}
}
